{extend name="../app/index/view/layout/main.html" /}
//网站标题
{block name="title"}<title>话题列表 - {$meta.appname}</title>{/block}

//css资源
{block name="link"}
<!-- 第三方库css -->
<link rel="stylesheet" href="__STATIC__/lib/layui/css/layui.css">
<link rel="stylesheet" href="__STATIC__/lib/swiper/css/swiper.css">

<!-- 自定义css -->
<link rel="stylesheet" href="__INDEX_STATIC__/css/common.css">
<link rel="stylesheet" href="__INDEX_STATIC__/css/app.css">
{/block}

//js资源
{block name="script"}
<script id="tagTpl" type="text/html">
  {{#  layui.each(d, function(index, item){ }}
  <li><a class="tag-item" href="{{ item.url }}">{{ item.name }}</a></li>
  {{#  }); }}
  {{#  if(d.length === 0){ }}
  无数据
  {{#  } }}
</script>
<script src="__STATIC__/lib/layui/layui.js"></script>
<script src="__INDEX_STATIC__/js/config.js"></script>
<script>
    'use strict';
    layui.use(['layer', 'jquery', 'nav', 'tags','search'], function(){
        let layer = layui.layer
            ,$ = layui.jquery
            ,search = layui.search
            ,tags = layui.tags;


        //标签 搜索展示页码
        search.init({
            search : 'search',
            fields:{}
        }).pagination({
            pageElem : $('#pagination')[0],
            count: "{$count}",
            limit : "{$limit}",

            box: $('#tag_box')[0],
            url: "{:url('tag/list')}",
            tpl: $('#tagTpl').html()
        },function(){
            tags.init('.cloud-tags');
        });



    });
</script>
{/block}

//body
{block name="body"}
<!-- body -->
<section class="body top-25">
  <div class="layui-container">
    <div class=" block">
      <div class="block-header flex-def flex-zBetween">
        <h2>
          <i class="layui-icon layui-icon-flag best-icon"></i>
          标签列表
        </h2><!--模糊搜索区域-->
        <form class="layui-form" action="">
          <div class="layui-form-item">
            <div class="layui-inline">
              <div class="layui-input-inline" style="width: 120px;">
                <input type="text" name="name" placeholder="名称" autocomplete="off" class="layui-input">
              </div>
              <div class="layui-input-inline" style="width:auto;">
                <button class="layui-btn" lay-submit="" lay-filter="search">
                  <i class="layui-icon layui-icon-search"></i>
                </button>
              </div>
            </div>

          </div>
        </form>
      </div>

      <!-- tags -->
      <ul id="tag_box" class="cloud-tags flex-def top-25">
<!--        <li><a class="tag-item" href="#">PHP</a></li>-->
      </ul>

      <!-- pager -->
      <div id="pagination" class="flex-def flex-zCenter top-25">
        <div id="pager"></div>
      </div>
    </div>
  </div>
</section>
{/block}